﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.FlowAppPower.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;

namespace Basic.FlowGatewayModule.Api
{
    [ApiRouteName("/flow/app/power/{name}")]
    internal class FlowAppPowerApi : ApiController
    {
        private readonly IFlowAppPowerService _Service;

        public FlowAppPowerApi ( IFlowAppPowerService service )
        {
            this._Service = service;
        }

        public void Delete ( [NumValidate("flow.app.id.error", 1)] long appId )
        {
            this._Service.Delete(appId);
        }

        public AppPowerDto Get ( [NumValidate("flow.app.id.error", 1)] long appId )
        {
            return this._Service.Get(appId);
        }

        public void Set ( AppPowerSet data )
        {
            this._Service.Set(data);
        }
    }
}
